#!/bin/bash

echo "********************** adb shell run **********************"

function run_adb_cmd() {
    # adb remount

    adb shell rm -r /data/local/tmp/opencl_demo
    adb shell mkdir /data/local/tmp/opencl_demo

    adb shell rm /data/local/tmp/opencl_demo/OpenCLDemo

    adb push ./OpenCLDemo /data/local/tmp/opencl_demo

    adb shell chmod 0777 /data/local/tmp/opencl_demo/OpenCLDemo
    adb shell "LD_LIBRARY_PATH=/data/local/tmp/opencl_demo/ /data/local/tmp/opencl_demo/OpenCLDemo"
}

run_adb_cmd